package com.luculent.conf.durid;

/**
 * 多事物管理
 * @author ShiQiang
 *
 */

public class DatabaseConfiguration {
//	@Bean
//	public PlatformTransactionManager transactionManager1(EntityManagerFactory entityManagerFactory) {
//		return new JpaTransactionManager(entityManagerFactory);
//	} 
	 
	// 创建事务管理器1
//    @Bean(name = "transactionManager")
//    public PlatformTransactionManager txManager(DataSource dataSource) {
//        return new DataSourceTransactionManager(dataSource);
//    }
//	@Bean
//	@ConfigurationProperties
//	public DataSource druidDataSource(){
//	    DruidDataSource druidDataSource = new DruidDataSource (); 
//	    return druidDataSource;
//	}
//	
//	@Bean
//    public PersistenceExceptionTranslationPostProcessor exceptionTranslation(){
//        return new PersistenceExceptionTranslationPostProcessor ();
//    }
//	@Bean
//    public LocalSessionFactoryBean sessionFactory(){
//        LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean ();
//        sessionFactory.setDataSource (this.druidDataSource ());
//        sessionFactory.setPackagesToScan (new String[] { "com" }); 
//       // sessionFactory.setHibernateProperties (hibernateProperties ());
//        return sessionFactory;
//    } 
}